﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Scheduler
{
    /**Class: ManagerMain
     * @author Sara Tuohy
     * @version 1.0
     * Course  : ITEC 4860 Spring, 2012
     * Written : March, 2012
     * ManagerMain is called when a manager ID logs in
     * ManagerMain provides the options available to Manager IDs
     */

    public partial class ManagerMain : Form
    {
        /**
         * Panel for Staffing Requirements                                   */
        private StaffReqForm staffReqPanel;
        /**
         * Calling Panel                                                     */
        private Driver homePanel;
        /**
         * Panel for Employee Listing                                        */
        private Scheduler.Presentation_Layer.EmployeeListing empListPanel;
        /**
         * Panel for Account Management                                      */
        private AcctManagement acctMgmtPanel;
        /**
         * Panel for Management Preferences                                  */
        private ManagerPreferences mgrPrefsPanel;
        /**
         * Panel for Displaying the schedule                                 */
        private Scheduler.Presentation_Layer.WeekDisplayer weekDisplayPanel;
        /**
         * Panel for Resetting his own password                              */
        private Scheduler.Presentation_Layer.PasswordReset passwordResetPanel;

        /**
         * ManagerMain constructor
         * The panels that are called by the various option buttons
         * are initialized in the constructor.
         * The home panel (caller) is hidden when ManagerMain is displayed
         * @param Driver panel - so we can return to the calling panel 
         */
        public ManagerMain(Driver hp)
        {
            homePanel = hp;
            InitializeComponent();
            homePanel.Hide();
            //homePanel.close(); <--this shut down the application.
        }

        /**Method: mgrStaffReqButton_Click 
         * calls the StaffRequirements panel
         */
        private void mgrStaffReqButton_Click(object sender, EventArgs e)
        {
            staffReqPanel = new StaffReqForm(this);
            staffReqPanel.ShowDialog();
        }


        /**Method: OnFormClosing
         * Returns the home (caller) panel
         */
        protected override void OnFormClosing(FormClosingEventArgs e)
        {
            homePanel.Show();
        }


        /**Method: mgrAcctMgmtButton_Click
         * Calls the Account Management Panel
         * To give access to the Account Management functions
         */
        private void mgrAcctMgmtButton_Click(object sender, EventArgs e)
        {
            acctMgmtPanel = new AcctManagement();
            acctMgmtPanel.ShowDialog();
        }


        /**Method: mgrPrefsButton_Click
         * Calls the Manager Preferneces Panel
         * To give access to the Manager Preferences functions
         */
        private void mgrPrefsButton_Click(object sender, EventArgs e)
        {
            mgrPrefsPanel = new ManagerPreferences();
            mgrPrefsPanel.ShowDialog();
        }


        /**Method: mgrEmpListButton_Click
         * Calls the Employee List Panel
         * To access Employees List function
         */
        private void mgrEmpListButton_Click(object sender, EventArgs e)
        {
            empListPanel = new Presentation_Layer.EmployeeListing();
            empListPanel.ShowDialog();
        }


        /**Method: mgrViewPrevSchedsButton_Click
         * Calls the weekDisplayPanel
         * To give access to previous schedules
         */
        private void mgrViewPrevSchedsButton_Click(object sender, EventArgs e)
        {
            weekDisplayPanel = new Presentation_Layer.WeekDisplayer();
            weekDisplayPanel.ShowDialog();
        }

        /**Method: mgtPasswordResetButton_Click
         * Call password reset panel
         * Comment just to make sure this stays changed
         */
        private void mgrPasswordResetButton_Click(object sender, EventArgs e)
        {
            passwordResetPanel = new Presentation_Layer.PasswordReset();
            passwordResetPanel.ShowDialog();
        }
    }
}
